/****************************************************************
 * I am the AC 130 vs Pirate game. I allow the user to control an 
 * AC130 gunship in the hunt for Modern day pirates. The player  
 * will be allowed to roam free across a section of ocean/coastline.  
 * In the water there will be four types of vessels: Merchant  
 * ships that the player must protect, Pirate ships that the player  
 * must identify and destroy, Fishing boats that look like Pirate  
 * ships that the player must not destroy, and Friendly Navy ships  
 * that can capture pirates for extra points. Time permitting there  
 * may also be ground targets to attack. 
 *
 * Key elements of this project will be the Player/AC130, the Ships,  
 * the ShipAI system, the collision grid, the debris controller, the  
 * Ground/Water, Clouds, and scoring system. This project will make  
 * use of an external text file to store useful game parameters,  
 * thus allowing us to play balance the game without recompiling  
 * the executable. 
 *****************************************************************
 * I am the Ship object. I contain all the data to render a ship 
 * into the game sceene. I expect my container class to controll 
 * my destination point. I will update and draw the ship that
 * is stored by my internal classes.
 *****************************************************************/


#include "Camera.h"
#include "GameData.h"
#include "Bullet.h"
#include "GameData.h"
#include <allegro.h>

#ifndef __SHIP_H__
#define __SHIP_H__

class Ship {
public:
	GameData * gd;

	int shipType;

	Point * center;
	Point * helper;
	float angleDlt;
	float angle;
		// speed and turn rate values
	float speedMax;
	float speedDlt;
	float speedCur;

		// external navigation information
	bool atDest;	// indictor that we need to activate the next sequenc in animation
	int navIndex;	// index of the navigation node we are heading to.
	Point * navDest;	// set externaly
	Point * nearDest;	// set externaly
	float nearDesire;	// priority of the near point
		// AI values
	// 0-player, 1-merchant, 2-fisherman, 3-pirate
	int aiLoyalty;
	// 0-navigate, 1-run, 2-attack, 3-go home, 4-hijacked, 5 derilict
	int aiMode;	

	bool reDrawTmp;
	BITMAP * tempBmp;	// local
	BITMAP * btmBmp;	// external
	BITMAP * topBmp;	// local

	// todo Crew stations

	int hp;	// hit pionts
		// sinking values
	int maxSinkTime;
	int maxSinkPhase;
	int sinkTime;
	int sinkPhase;
public:
	Ship();
	~Ship();

	void Init(GameData * exGd);

	bool GetHit(Bullet * shot);
	void PaintHit(BITMAP * tgt, BITMAP * mask, int tgtX, int tgtY, int maskX, int maskY);
	void Update();
	void SetNavi();
	void DrawTemp();
	void Draw(Camera * cam);


};
#endif